var app=getApp()
Page({
    data: {
        navState:0
    },
    bindchange(e) {
        // console.log(e.detail.current)
        let index = e.detail.current;
        this.setData({
          navState:index
        })
      },
      //点击导航
      navSwitch: function(e) {
        // console.log(e.currentTarget.dataset.index)
        let index = e.currentTarget.dataset.index;
        this.setData({
          navState:index
        })
      },
    goToStudyRoom:function(){
      wx.navigateTo({
        url: '/pages/study-room/study-room',
      })
    },
    onLoad :function(options){
      let that = this;
      wx.request({
      url: app.globalData.url+'/',
      method: 'GET',
      data: {},
      header: { 
        'content-type': 'application/x-www-form-urlencoded'
      },
      success:function(res) {
        console.log(res.data.data)
          that.setData({
            result:res.data.data
          })
        }
        
      })


}
})

